<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2018/11/13/013
  Time: 12:05
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<footer class="page-footer fixed-footer" id="footer">
    <ul id="footul">
        <li class="actives" onclick="foot(this)">
            <a href="../jsp/index.jsp?liindex=0">
                <i class="iconfont icon-shouyev1"></i>
                <p>首页</p>
            </a>
        </li>
        <li class="actives" onclick="foot(this)">
            <a id="lease">
                <i class="iconfont icon-chuzuwo"></i>
                <p>我要出租</p>
            </a>
        </li>
        <li class="actives"  id="schedule">
            <a >
                <i class="iconfont icon-richengbiao"></i>
                <p>房东订单</p>
            </a>
        </li>
        <li  class="actives" onclick="foot(this)">
            <c:choose>
            <c:when test="${sessionScope.user eq null}">
            <a href="<%=path%>/jsp/sign.jsp">
                </c:when>
                <c:otherwise>
                <a href="<%=path%>/user/p-center.html?liindex=3">
                    </c:otherwise>
                    </c:choose>
                    <i class="iconfont icon-gerenzhongxin"></i>
                    <p>个人中心</p>
                </a>
        </li>
    </ul>
</footer>
<script type="text/javascript" src="../statics/js/jquery-1.12.4.js" ></script>
<script src="../statics/layui/layui.all.js"></script>
<script>
    var  index="${param.liindex}"==""? "0":"${param.liindex}"
    $("#footul li:eq('"+index+"')").addClass("active");

    $(function(){
        var user = <%=session.getAttribute("userJson")%>;
        $("#lease").click(function(){
            if(user==null ||user =="" || user==undefined){
                var layer = layui.layer
                    , form = layui.form;
                layer.msg('请登录...');
                location.href="../jsp/sign.jsp";
            }else if(user.name==null || user.cardId ==null){
                var layer = layui.layer
                    , form = layui.form;
                layer.msg('请完善个人资料...');
                location.href="../user/p-center.html?liindex=3";
            }else{
                location.href="../house/leasePage.html?liindex=1";
            }
        })

        $("#schedule").click(function(){
            if(user==null ||user =="" || user==undefined){
                var layer = layui.layer
                    , form = layui.form;
                layer.msg('请登录...');
                location.href="../jsp/sign.jsp";
            }else {
                location.href="<%=path%>/orders/schedule.html?liindex=2";
            }
        })
    })
</script>
